﻿using Microsoft.AspNetCore.Mvc;
using System.Net;

namespace API.Controllers
{
    [ApiController]
    [Route("Health/[action]")]
    public class HealthController : ControllerBase
    {
        /// <summary>
        /// 心跳
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult Alive()
        {
            return Ok();
        }

        /// <summary>
        /// 获取主机信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns>主机名</returns>
        [HttpGet]
        public ActionResult GetDNS()
        {
            //TODO 限制获取主机信息
            //if (id == "he")
                return Ok(Dns.GetHostName());


            //return Forbid();
        }
    }
}
